<!-- Data Tables -->
<div class="wrapper wrapper-content animated fadeInRight">
    <div class="row">
        <div class="col-lg-12">
            <div class="ibox float-e-margins" style="background: white;padding: 10px">
                <!-- 表单标题概要 -->
                <div class="ibox-title">
                    <h5>{:lang('Account List')}</h5>
                    <!--<div class="ibox-tools">-->
                        <!--<a class="collapse-link">-->
                            <!--<i class="fa fa-chevron-up"></i>-->
                        <!--</a>-->
                        <!--<a class="close-link">-->
                            <!--<i class="fa fa-times"></i>-->
                        <!--</a>-->
                    <!--</div>-->
                </div>
                <div class="btn-group">
                    <a class="btn btn-primary" type="button" href="add.html">
                        <i class="fa fa-plus" aria-hidden="true" style="margin-right: 2px"> </i>
                        添加管理员
                    </a>
                </div>
                <!-- 表单内容 -->
                <table class="table table-bordered table-hover table-responsive">
                    <thead>
                        <tr>
                            <th>账号</th>
                            <th>状态</th>
                            <th>类别</th>
                            <th>最后登录时间</th>
                            <th>最后登录ip</th>
                            <th>操作</th>
                        </tr>
                    </thead>
                    <tbody>
                    {volist name="lists" id="vo"}
                        <tr>
                            <td>{$vo.admin_user}</td>
                            <td>{$vo.admin_type|checktype}</td>
                            <td>{$vo.admin_level|checklevel}</td>
                            <td>{:date('Y-m-d H:i:s',$vo.update_time)}</td>
                            <td>{$vo.admin_ip}</td>
                            <td>
                                <a href='{:url("edit","id=$vo[id]")}' class="btn btn-warning" type="button">修改</a>
                                {eq name="$vo.admin_level" value="2"}
                                <a href="javascript:void(0)" class="btn btn-danger" type="button" onclick="return del({$vo['id']})">删除</a>
                                {/eq}

                            </td>
                        </tr>
                    {/volist}
                    </tbody>
                </table>






                <!--<div class="ibox-content">-->
                    <!--&lt;!&ndash; 用户控件（操作） &ndash;&gt;-->
                    <!--{toolbar id="toolbar"}-->

                    <!--{/toolbar}-->
                    <!--&lt;!&ndash; 表格数据 &ndash;&gt;-->
                    <!--<table id="table" data-toggle="gridview" class="table" data-url="{:url('admin/user/getList')}" data-toolbar="#toolbar" data-show-columns="true" data-page-size="10" data-page-list="[10, 25, 50, All]" data-unique-id="id" data-pagination="true" data-side-pagination="client" data-search="true" data-click-to-select="false">-->
                        <!--<thead>-->
                            <!--<tr>-->
                                <!--<th data-width="10" data-align="center" data-checkbox="true"></th>-->
                                <!--<th data-width="50" data-field="username" >{:lang('Account')}</th>-->
                                <!--<th data-width="80" data-field="mobile" data-align="center">{:lang('Mobile')}</th>-->
                                <!--<th data-width="50" data-field="status" >{:lang('Status')}</th>-->
                                <!--<th data-width="80" data-field="create_time" data-align="center">{:lang('Create Time')}</th>-->
                                <!--<th data-width="80" data-field="operate"   data-align="center" data-formatter="operateFormatter" data-events="operateEvents">{:lang('Operate')}</th>-->
                            <!--</tr>-->
                        <!--</thead>-->
                    <!--</table>-->
                <!--</div>-->
            </div>
        </div>
    </div>
</div>

<script type="text/javascript">
    //弹出确认操作
    function del(id){
        if(confirm("您确定要删除该管理员吗?")){
            window.location = "doDel/id/"+id;
        }
    }
    function operateFormatter(value, row, index) {
        return [
            '<a class="btn btn-xs edit" href="javascript:void(0)" title="{$Think.lang.Edit}">',
            '<i class="fa fa-edit"></i>',
            '</a>  ',
            '<a class="btn btn-xs delete" href="javascript:void(0)" title="{$Think.lang.Delete}">',
            '<i class="fa fa-trash"></i>',
            '</a>'
        ].join('');
    }

    var operateEvents = {
        'click .edit': function (e, value, row, index) {
            var param = {
                url: "{:url('admin/user/edit');}",
                data: {id: row.id}
            }
            $("#table").gridView('loadModal', param.url,param.data)
        },
        'click .delete': function (e, value, row, index) {
            $("#table").gridView('deleteModal', 'delete', row)
            
        }
    };

</script>
